import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';
import 'package:hygf/bean/AddTaKanBean.dart';
import 'package:hygf/view/image_picker_widget.dart';

import '../../../../bean/CustomerList.dart';
import '../../../../config/GlobalConfig.dart';
import '../../../../util/format_util.dart';
import '../../../../util/location/hap_location.dart';

class ExploreMsgState {
  bool isReadOnly = true;
  String title = "";
  ReconnaissanceLink rnInfo = ReconnaissanceLink();
  AddTaKanBean addTaKanBean = AddTaKanBean();
  TextEditingController rnNameController = TextEditingController();
  TextEditingController rnPhoneController = TextEditingController();
  TextEditingController rnTypeController = TextEditingController();
  TextEditingController rnLocationController = TextEditingController();
  TextEditingController rnTimeController = TextEditingController();
  TextEditingController rnRemarkController = TextEditingController();

  TextEditingController areaNameController = TextEditingController();
  TextEditingController areaCapacityController = TextEditingController();
  TextEditingController areaDistanceController = TextEditingController();
  ImagePickerWidgetController roughSketchController =
      ImagePickerWidgetController();
  ImagePickerWidgetController surveySheetController =
  ImagePickerWidgetController();
  ImagePickerWidgetController panoramicPhotoController =
      ImagePickerWidgetController();
  ImagePickerWidgetController rnGatePhotoController =
      ImagePickerWidgetController();
  ImagePickerWidgetController oppositeAnglesPhotoController =
      ImagePickerWidgetController();
  ImagePickerWidgetController externalDetailPhotoController =
      ImagePickerWidgetController();
  ImagePickerWidgetController rnOtherImgController =
      ImagePickerWidgetController();

  ExploreMsgState() {
    var map = Get.arguments;
    if (map["pageData"] != null) {
      CustomerListItem itemData = map["pageData"];
      rnInfo.customerInfoId = itemData.id;
      if (itemData.status == 3) {
        rnInfo.userName = GlobalConfig.loginEntity?.userName;
        rnInfo.surveyMethod = "人工踏勘";
        rnInfo.phoneNumber = GlobalConfig.loginEntity?.phoneNumber ?? "";
        rnInfo.surveyDate = FormatUtil.formatTime(DateTime.now());
        title = map["title"];
        isReadOnly = false;
      }else if(itemData.status == 4 || itemData.status == 6){
        isReadOnly = false;
      }
    }
  }
}
